Option Explicit
Sub Q_Sample015()
    ']wޥζMicrosoft Scripting Runtime
    Dim myFso As Scripting.FileSystemObject
    Dim myTxt As Scripting.TextStream
    Dim myStr As String
    Set myFso = CreateObject("Scripting.FileSystemObject")
    'wɮ
    Set myTxt = myFso.OpenTextFile(Filename:=ThisWorkbook. Path & "\Test.txt", _
    IOMode:=ForReading)
    With myTxt
        myStr = .ReadAll
        .Close
    End With
    myStr = Replace(myStr, "", "test")
    'wɮ
    Set myTxt = myFso.OpenTextFile(Filename:=ThisWorkbook. Path & "\Test.txt", _
    IOMode:=ForWriting)
    With myTxt
        .Write myStr
        .Close
    End With
    'wɮ
    Set myTxt = myFso.OpenTextFile(Filename:=ThisWorkbook. Path & "\Test.txt", _
    IOMode:=ForReading)
    With myTxt
        myStr = .ReadAll
        Debug.Print myStr
        .Close
    End With

    Set myTxt = Nothing			'
    Set myFso = Nothing
End Sub
